
import {RouteObject} from 'react-router-dom'
import Login from '@/views/Login/Login'

import Auth from './Auth'
import { lazy } from 'react'
import lazyLoad from './lazyLoad'
import NotFound from '@/views/NotFound'
const Home=lazy(()=>import('@/views/Home/Home'))
const User=lazy(()=>import('@/views/Home/system/User'))
const Role=lazy(()=>import('@/views/Home/system/Role'))
const Menu=lazy(()=>import('@/views/Home/system/Menu'))
const Dict=lazy(()=>import('@/views/Home/system/Dict'))
const routes:Array<RouteObject>=[
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'/home',
        element:lazyLoad(<Auth>
           <Home></Home>
        </Auth>),
        children:[
            {
                path:'system/user',
                element:lazyLoad(<User></User>)
            },
            {
                path:'system/role',
                element:lazyLoad(<Role></Role>)
            },
            {
                path:'system/menu',
                element:lazyLoad(<Menu></Menu>)
            },
            {
                path:'system/dict',
                element:lazyLoad(<Dict></Dict>)
            }
        ]
    },
    {
        path:'*',
        element:<NotFound></NotFound>
    }
]
export default routes